Skip to content

Fix crash when unexporting a destroyed Wayland surface - #235

Open
City-busz wants to merge 1 commit into
flatpak:mainfrom
City-busz:patch-1
Open

City-busz wants to merge 1 commit into
flatpak:mainfrom
City-busz:patch-1

Conversation

@City-busz

Copy link
Copy Markdown

When a GTK4 window is destroyed while a portal request is still pending, gtk_native_get_surface() may return NULL during _xdp_parent_unexport_gtk().

Passing this NULL surface to gdk_wayland_toplevel_drop_exported_handle() causes a crash when the portal request completes.

Check whether the surface still exists before attempting to unexport the handle.

The surface may already have been destroyed when a portal request
completes, causing gtk_native_get_surface() to return NULL.

Check the surface before attempting to unexport the Wayland handle
to avoid dereferencing a NULL pointer.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant